VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Iterator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Iterator
Option Explicit
Private iIndex As Integer
Private dic As Object
Private arr()

Function init(sArr())
    arr = sArr
End Function

Function isIn(keyword As Variant) As Boolean

    Set dic = CreateObject("Scripting.Dictionary")
    With dic
    .comparemode = vbTextCompare
    
    For iIndex = LBound(arr) To UBound(arr)
        dic(arr(iIndex)) = index
    Next iIndex
    
    
    If .exists(keyword) Then
        iIndex = dic(keyword)
    Else
        iIndex = Empty
    End If
    
    isIn = .exists(keyword)
    End With
End Function



Property Get index() As Integer
    index = iIndex
End Property